/*
 * @Author: qiuz
 * @Date: 2018-05-04 14:46:46
 * */

var _ = require('lodash');

const stringSplit = (str, key, ...arg) => {
  console.log(str);
  if (!str || arg.length < 1) return;
  arg.forEach(splitStr => {
    str = _.isArray(str)
      ? str.map(item => {
          return item.split(splitStr);
        })
      : str.split(splitStr);
  });
  let value = '';
  str.some(item => {
    if (item.indexOf(key) > -1) return (value = item[1]);
  });
  return value;
};

export default stringSplit;
